import type { StoreDefinition } from 'pinia'
import { defineStore } from 'pinia'
import type { AppConfigActionsType, AppConfigInterface } from '@/stores'
import { THEMEENUM } from '@/stores'
// @ts-ignore
export const useConfigStore: StoreDefinition<"config", AppConfigInterface, {}, AppConfigActionsType> = defineStore('appConfig', {
  state: ()  => ({
    theme: THEMEENUM.light,
    lang : 'en'
  }),
  getters: {
  },
  actions: {
    changeLang(language:string){
      this.lang = language;
    }
  },
  persist: {
    enabled: true , // 这个配置代表存储生效，而且是整个store都存储
  }
});
